/*************************************************************
 * @file        rt_indicator.c    
 * @brief     
 *
 *
 * @version   
 * @author     
 * @data       
 *************************************************************/
 
 
 
 #include "rt_indicator.h"
 
 #include "audio_mgr.h"
 #include "gpio.h"

uint8_t RTState  = RTState_Idle;
 

void RTState_StartTx(void)
{
	RTState  |= RTState_Txing;
	
	Audio_Disable();
	LedTxOn();
	
	if(RTState & RTState_Rxing){
		LedRxOff();
	}
}




void RTState_StopTx()
{
	RTState  &= ~RTState_Txing;	
    Audio_Enable();
	
    LedTxOff();
	
	if(RTState & RTState_Rxing){		
		Audio_TurnOn(SpkOwner_Rx);
	}
}



void RTState_StartRx()
{
	RTState  |= RTState_Rxing;
	
	if( !(RTState & RTState_Txing) ){
		LedRxOn();
		Audio_TurnOn(SpkOwner_Rx);
	}
}


void RTState_StopRx()
{
	RTState  &= ~RTState_Rxing;
	
	LedRxOff();
	Audio_TurnOff(SpkOwner_Rx);
}